<?php
class SF_PromoteEvents_Block_Adminhtml_Eventslist_Edit_Tab_Form extends Mage_Adminhtml_Block_Widget_Form
{
	protected function _prepareForm()
	{
		$form = new Varien_Data_Form();
		$this->setForm($form);
		$fieldset = $form->addFieldset('promoteevents_form', array('legend'=>$this->__('Item information')));

		$fieldset->addField('event_title', 'text', array(
		    'label'     => $this->__('Event Title'),
		    'class'     => 'required-entry',
		    'required'  => true,
		    'name'      => 'event_title',
		    'tabindex' => 0,
		));		

        $fieldset->addField('from_date', 'date', array(
          'label'     => $this->__('From Date'),
          'required'  => true,
          'time'      =>    true,
          'tabindex' => 1,
          'name' => 'from_date',
          'readonly' => true,
          'image' => $this->getSkinUrl('images/grid-cal.gif'),
          'format'    =>    "MM/dd/yyyy H:mm:ss",
        ));
        
        $fieldset->addField('to_date', 'date', array(
            'label'     => $this->__('To Date'),
            'time'      =>    true,
            'tabindex' => 1,
            'name' => 'to_date',
            'readonly' => true,
            'image' => $this->getSkinUrl('images/grid-cal.gif'),
            'format'    =>    "MM/dd/yyyy H:mm:ss",
        ));
		
		$fieldset->addField('is_active', 'select', array(
			'label'     => $this->__('Is Active'),
			'required'  => true,
			'name'      => 'is_active',
			'values'    => array(
			                         0 => 'Disabled',
			                         1 => 'Enabled',
			                     ),
		));
		

		if ( Mage::getSingleton('adminhtml/session')->getpromoteeventsData() )
		{
			$form->setValues(Mage::getSingleton('adminhtml/session')->getpromoteeventsData());
			Mage::getSingleton('adminhtml/session')->setpromoteeventsData(null);
		} elseif ( Mage::registry('promoteevents_data') ) {
			$form->setValues(Mage::registry('promoteevents_data')->getData());
		}
		return parent::_prepareForm();
	}
}

